TEMPORALS
Photo by Marco Lastella on Unsplash
The greatest power is not money power, but political power….
— Walter Annenberg
url_root <- "https://raw.githubusercontent.com/UN-AVT/kamino-source/main/sources/0-shared/data/"
url_file <- "different-political-regimes/different-political-regimes.csv"
url <- paste0(url_root, url_file)
df <- read.csv(url, header = TRUE)
head(df, n=10)
theme_opts <- theme(
text = element_text(family = "inconsolata"),
plot.title = element_text(color = "black", size = 14, face = "bold", family = "inconsolata"),
plot.subtitle = element_text(color = "black", size = 12, family = "inconsolata"),
plot.caption = element_text(color = "#555555", size = 8, family = "inconsolata"),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
panel.border = element_blank(),
panel.background = element_blank(),
panel.grid.minor = element_blank(), # remove minor gridlines
panel.grid.major.x = element_blank(), # remove x (vertical) gridlines
legend.title = element_blank(), # remove legend title
legend.text = element_text(color = "black", size = 8),
legend.position='top'
)
df$Regime <- factor(df$Regime , levels=c("Dictatorship or Monarchy", "Closed Anocracy", "Open Anocracy", "Transition or no Data", "Colony", "Democracy"))
# Create a color palette
colors <- c("Democracy" = "#7c94a5", "Colony" = "#9ebdd5", "Transition or no Data" = "#dbdbdb",
"Open Anocracy" = "#f2dba3", "Closed Anocracy" = "#e7b455", "Dictatorship or Monarchy" = "#c47361")
# Plot
v1 <- ggplot(df, aes(x=Year, y=Percent)) +
geom_area(aes(color = Regime, fill=Regime), alpha=1.0 , size=1) +
scale_x_continuous(breaks=c(1820,1840,1860,1880,1900,1920,1940,1960,1980,2000)) +
scale_y_continuous(breaks=seq(0, 100, 10)) +
scale_fill_manual(values = colors) +
scale_color_manual(values = colors) +
labs( title = "Number of world citizens living under different political regimes",
subtitle = "The Polity IV score captures the type of political regime for each country on a range from -10 (full autocracy) to +10 (full democracy).\nRegimes that fall into the middle of this spectrum are called anocracies.",
caption = "Calculations by Max Roser based on Polity IV data,\nand data from Wimmer and Min (2006),\nGapminder.org, UN Population Division (2015 rev), and Our World in Data") +
theme_bw() +
theme_opts
girafe(ggobj = v1, width_svg = 16, height_svg = 9,
options = list(opts_sizing(rescale = TRUE, width = 1.0)))
v2 <- v1 + annotate("text", x = 1825, y = 10,
label = paste0("Until 1944, more than", "\n", "30% of the world", "\n", "population was home", "\n", "in colonies."),
hjust = "left", vjust = 0, color = "#ffffff", size = 3, fontface = 1, family = "inconsolata") +
annotate("text", x = 1985, y = 5,
label = paste0("50% of the world", "\n", "population have been", "\n", "living in a democracy", "\n", "since 1994."),
hjust = "left", vjust = 0, color = "#ffffff", size = 3, fontface = 1, family = "inconsolata")
girafe(ggobj = v2, width_svg = 16, height_svg = 9,
options = list(opts_sizing(rescale = TRUE, width = 1.0)))